package com.kly.smartbi.bizmq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author admin
 * @date 2025/4/3
 */
@Component
@Slf4j
public class MessageConsumer {

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(value = "test.queue", durable = "true"),
            exchange = @Exchange(value = "text.exchange", delayed = "true"),
            key = {"test"}
    ))
    public void testConsumer(String message) {
        log.info("test.queue 接收到消息：{}", message);
    }
}
